<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>供应商平台</title>
</head>
<body class="tob-wrap">
	<div th:replace="common/top"></div>
	<article class="container container-b1-supplier clearfix">
		<div th:replace="common/left::side"></div>
		<section class="content">
			<div class="m-crumb">
				<p>
					<a href="#">订单管理 > </a> <span>验收申请</span>
				</p>
			</div>
			<div class="m-order-info">
				<table width="100%" summay="" cellpadding="0" cellspacing="0">
					<tr>
						<td>
							<p  th:text="'订单编号：'+${salesOrder.salesOrderNo}"></p>
							<p  th:text="'发货单号：'+${date}"></p>
							<p>总金额：<span th:text="${salesOrder.currency eq 0}? '￥':'$'"/><span th:text="${#numbers.formatInteger(salesOrder.price,1)}"/></p>
						</td>
						<td>
						<p>时   间：<label th:if="${salesOrder.startTime ne null and salesOrder.expiredTime ne null}" th:text="${#dates.format(salesOrder.startTime, 'yyyy-MM-dd')}+'
							 至 '+${#dates.format(salesOrder.expiredTime, 'yyyy-MM-dd')}"/></p>
							<p  th:text="'采购商：'+${salesOrder.tCompany.companyName}"></p>
							<p  th:text="'送货地址：'+${salesOrder.deliverAddress}"></p>
						</td>
						<td class="w150 txR"></td>
					</tr>
				</table>
			</div>
			<div class="m-table-sell">
				<div class="m-table-cont">
					<table width="100%" summay="" cellpadding="0" cellspacing="0">
						<thead>
							<tr>
								<th>序号</th>
								<th>描述</th>
								<th>计划金额</th>
								<th>实际金额</th>
								<th>操作</th>
							</tr>
						</thead>
					   <tbody>
					  
					  <div th:each="tSalesOrderPayment,index:${tSalesOrderPaymentList}">
					   <form id="form_personal" action="#" method="post" th:action="@{/supplier/checkOrderInsert(salesOrderID=${tSalesOrderPayment.id})}" th:object="${tSalesOrderPayment}" th:method="post" enctype="multipart/form-data">
					 <tr class="edit-tr-wrap" th:id="'tr'+${tSalesOrderPayment.id}" th:field="*{id}" ><!-- 此方法的参数00要和tr的id一样 -->
                     
                        <td>
							<span name="salesOrderIndex" id="salesOrderIndex" th:if="${#strings.length(index.count) eq 1}" th:text="${#strings.prepend(index.count,'00')}"/>
                    		<span name="salesOrderIndex" id="salesOrderIndex" th:if="${#strings.length(index.count) eq 2}" th:text="${#strings.prepend(index.count,'0')}"/>
                    		<span name="salesOrderIndex" id="salesOrderIndex" th:if="${#strings.length(index.count) eq 3}" th:text="${index.count}"/>
                    	</td>
                        <td th:text="${tSalesOrderPayment.remark}"></td>
                        <td th:text ="${#numbers.formatInteger(tSalesOrderPayment.planAmount,1)}"></td>
                        <td th:text ="${#numbers.formatInteger(tSalesOrderPayment.paidAmount,1)}"></td>
                        <td th:if="${index.count==1}"><a data-trid="tr00" th:href="'javascript:editcell('+${tSalesOrderPayment.id}+',this)'"><i class="icon icon-tr-open"></i> 收起编辑</a></td>
                        <td th:if="${index.count!=1}"><a data-trid="tr00" th:href="'javascript:editcell('+${tSalesOrderPayment.id}+',this)'"><i class="icon icon-tr-open"></i> 展开编辑</a></td>
                    </tr>
                    <tr  th:if="${index.count!=1}" th:id="'edtr'+${tSalesOrderPayment.id}" class="edit-tr" style="display:none" ><!-- 此方法的参数00要和tr的id一样 -->
                        <td colspan="5">
                            <table width="100%" summay="" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td colspan="3">
                                        <p>
                                            <span>付款百分比：</span>
                                            <span class="m-percent-bar">
                                                <span class="m-percent-bar-status" th:style="'width:'+${baiFenBi}+'%'"></span>
                                            </span>
                                            <span th:text="${baiFenBi}+'%'" th:field="*{percentage}"></span>
                                        </p>
                                    </td>
                                </tr>
                                <tr>
                                    <td th:text="'计划时间：'+${#dates.format(tSalesOrderPayment.planTime, 'yyyy-MM-dd')}"></td>
                                    <td>
                                        <p class="p-calendar">
                                            <span >实际时间：</span>
                                            <input class="input input-datepicker" type="text" name="realTime1" th:value="${realTime1}"></input>
                                            <i class="icon icon-calendar"></i>
                                        </p>
                                    </td>
                                    <td th:text ="'计划金额：￥'+${tSalesOrderPayment.planAmount}"></td>
                                </tr>
                                <tr>
                                    <td>实际开票金额：￥<input   class="input" type="text" th:field="*{billedAmount}"></input></td>
                                    <td>其中，增值税：￥<input  class="input" type="text" th:field="*{increamentTax}"></input></td>
                                    <td>不含税金额：￥ <input   class="input" type="text" th:field="*{amountWithoutTax}"></input></td>
                                </tr>
                                <tr>
                                    <td>
                                        
                                        <p class="p-indent">
                                        <!--<input type="file" th:id="'btnFileBG'+${index.count}" th:name="'btnFileBG'+${index.count}" hidden="hidden" th:onchange="'BG_fileupLoad('+${tSalesOrderPayment.id}+')'"></input>
								        <a  th:onclick="'btnFileBG'+${index.count}+'.click()'">+增加验收报告</a>-->
								        <input type="file" th:id="'btnFileBG'+${index.count}" name="btnFileBG" hidden="hidden" onchange="BGFileId.text=this.value" >增加验收报告</input>
								        <a th:onclick="'btnFileBG'+${index.count}+'.click()'">+增加验收报告</a> 
                                        </p>
                                        <p class="p-indent"><span id="BGFileId">文件名A.pdf</span><a href="#">- 删除文件</a></p>
                                    </td>
                                    <td>
                                        <p>&nbsp;</p>
                                        <p class="p-indent" id="FPFileId">文件名A.pdf <a href="#">- 删除文件</a></p>
                                        <p class="p-indent">
                                        
                                      <!--  <input type="file" th:id="'FPbtnFile'+${index.count}" th:name="'FPbtnFile'+${index.count}" hidden="hidden" th:onchange="'FP_fileupLoad('+${tSalesOrderPayment.id}+')'"></input>
								       <a  th:onclick="'FPbtnFile'+${index.count}+'.click()'">+增加发票</a>-->
								       
								       <input type="file" th:id="'FPbtnFile'+${index.count}" name="FPbtnFile" hidden="hidden" onchange="FPFileId.text=this.value;" ></input>
								       <a  th:onclick="'FPbtnFile'+${index.count}+'.click()'">+增加发票</a> 
                                        </p>
                                    </td>
                                    <td></td>
                                </tr>
                                <tr>
                                    <td colspan="3">
                                        <p>
                                            <span class="vaT">填写备注：</span>
                                            <textarea class="textarea" cols="80" rows="5" th:text="${tSalesOrderPayment.orderPaymentRemark}" th:field="*{orderPaymentRemark}"></textarea>
                                        </p>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="3">
                                        <p class="btn-bar">
                                       <!--  <a  th:onclick="'javascript:participatePipeline('+${salesOrder.salesOrderNo}+','+${tSalesOrderPayment.id}+');'" class="btn btn-cyan btn-small">确定修改</a> -->
                                        <button class="btn btn-cyan" type="submit">提交</button>
                                        <a th:href="'javascript:editcell('+${tSalesOrderPayment.id}+',this)'" class="btn btn-simple btn-small">取消</a>
                                        </p>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    
                    
                     <tr  th:if="${index.count==1}" th:id="'edtr'+${tSalesOrderPayment.id}" class="edit-tr" style="display: table-row" ><!-- 此方法的参数00要和tr的id一样 -->
                        <td colspan="5">
                            <table width="100%" summay="" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td colspan="3">
                                        <p>
                                            <span>付款百分比：</span>
                                            <span class="m-percent-bar">
                                                <span class="m-percent-bar-status" th:style="'width:'+${baiFenBi}+'%'"></span>
                                            </span>
                                            <span th:text="${baiFenBi}+'%'" th:field="*{percentage}"></span>
                                        </p>
                                    </td>
                                </tr>
                                <tr>
                                    <td th:text="'计划时间：'+${#dates.format(tSalesOrderPayment.planTime, 'yyyy-MM-dd')}"></td>
                                    <td>
                                        <p class="p-calendar">
                                            <span >实际时间：</span>
                                            <input class="input input-datepicker" type="text" name="realTime1" th:value="${realTime1}"></input>
                                            <i class="icon icon-calendar"></i>
                                        </p>
                                    </td>
                                    <td th:text ="'计划金额：￥'+${tSalesOrderPayment.planAmount}"></td>
                                </tr>
                                <tr>
                                    <td>实际开票金额：￥<input   class="input" type="text" th:field="*{billedAmount}"></input></td>
                                    <td>其中，增值税：￥<input  class="input" type="text" th:field="*{increamentTax}"></input></td>
                                    <td>不含税金额：￥ <input   class="input" type="text" th:field="*{amountWithoutTax}"></input></td>
                                </tr>
                                <tr>
                                    <td>
                                        
                                        <p class="p-indent">
                                        <!--<input type="file" th:id="'btnFileBG'+${index.count}" th:name="'btnFileBG'+${index.count}" hidden="hidden" th:onchange="'BG_fileupLoad('+${tSalesOrderPayment.id}+')'"></input>
								        <a  th:onclick="'btnFileBG'+${index.count}+'.click()'">+增加验收报告</a>-->
								        <input type="file" th:id="'btnFileBG'+${index.count}" name="btnFileBG" hidden="hidden" onchange="BGFileId.text=this.value" >增加验收报告</input>
								        <a th:onclick="'btnFileBG'+${index.count}+'.click()'">+增加验收报告</a> 
                                        </p>
                                        <p class="p-indent"><span id="BGFileId">文件名A.pdf</span><a href="#">- 删除文件</a></p>
                                    </td>
                                    <td>
                                        <p>&nbsp;</p>
                                        <p class="p-indent" id="FPFileId">文件名A.pdf <a href="#">- 删除文件</a></p>
                                        <p class="p-indent">
                                        
                                      <!--  <input type="file" th:id="'FPbtnFile'+${index.count}" th:name="'FPbtnFile'+${index.count}" hidden="hidden" th:onchange="'FP_fileupLoad('+${tSalesOrderPayment.id}+')'"></input>
								       <a  th:onclick="'FPbtnFile'+${index.count}+'.click()'">+增加发票</a>-->
								       
								       <input type="file" th:id="'FPbtnFile'+${index.count}" name="FPbtnFile" hidden="hidden" onchange="FPFileId.text=this.value;" ></input>
								       <a  th:onclick="'FPbtnFile'+${index.count}+'.click()'">+增加发票</a> 
                                        </p>
                                    </td>
                                    <td></td>
                                </tr>
                                <tr>
                                    <td colspan="3">
                                        <p>
                                            <span class="vaT">填写备注：</span>
                                            <textarea class="textarea" cols="80" rows="5" th:text="${tSalesOrderPayment.orderPaymentRemark}" th:field="*{orderPaymentRemark}"></textarea>
                                        </p>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="3">
                                        <p class="btn-bar">
                                       <!--  <a  th:onclick="'javascript:participatePipeline('+${salesOrder.salesOrderNo}+','+${tSalesOrderPayment.id}+');'" class="btn btn-cyan btn-small">确定修改</a> -->
                                        <button class="btn btn-cyan" type="submit">提交</button>
                                        <a th:href="'javascript:editcell('+${tSalesOrderPayment.id}+',this)'" class="btn btn-simple btn-small">取消</a>
                                        </p>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                    
					</form>
					</div>
						</tbody>
					</table>
				</div>
			</div>

		</section>
	</article>
<p  th:if="${success==1}">
	<div class="m-popup">
        <div class="m-popup-in" style="width: 450px; margin: -150px 0 0 -240px;">
            <div class="m-popup-top">
                <h4>提示<span class="m-popup-top-btn">X</span></h4>
            </div>
            <div class="m-popup-content">
                <p>修改成功</p>
            </div>
            <div class="m-popup-footer">
                <p>
                    <a class="btn btn-cyan" href="../supplier/orderList.htm">确定</a>
                </p>
            </div>
        </div>
        <div class="m-popup-bg"></div>
    </div>
	</p>
	<p  th:if="${success==2}">
	<div class="m-popup">
        <div class="m-popup-in" style="width: 450px; margin: -150px 0 0 -240px;">
            <div class="m-popup-top">
                <h4>提示<span class="m-popup-top-btn">X</span></h4>
            </div>
            <div class="m-popup-content">
                <p>请核实：实际开票金额=其中，增值税+不含税金额</p>
            </div>
        </div>
        <div class="m-popup-bg"></div>
    </div>
	</p>
	
	
	<p  th:if="${success==3}">
	<div class="m-popup">
        <div class="m-popup-in" style="width: 450px; margin: -150px 0 0 -240px;">
            <div class="m-popup-top">
                <h4>提示<span class="m-popup-top-btn">X</span></h4>
            </div>
            <div class="m-popup-content">
                <p>有参数未填写，请核查</p>
            </div>
        </div>
        <div class="m-popup-bg"></div>
    </div>
	</p>
</body>
<script th:inline="javascript">
	//<![CDATA[
	
	   var errorMsg = /*[[${errorMsg}]]*/;
	     	 	if(errorMsg){
	    	  alert(errorMsg);
	      	}
          function participatePipeline(salesOrderNo,chencNo){
          	
        	  	if(!confirm("您确认修改吗？")){
        	  		return;
        	  	}
        	  	window.location.href = "/supplier/checkOrderInsert?salesOrderNo=" + salesOrderNo+"&chenkNo="+chencNo;
          }
		//]]>
</script>  
<script data-main="../js/page/b3_vendor" src="../lib/requirejs/require.js"></script>
<script data-main="../js/page/b1_supplier" src="../lib/requirejs/require.js"></script>
<script type="text/javascript" src="../lib/jquery/dist/jquery.js"></script>
<script type="text/javascript" src="../lib/jquery/dist/ajaxfileupload.js"></script>
<script type="text/javascript" src="../js/page/b2_order.js"></script>
	
	
</html>